<!--#include file="Librerias/mssql-ds.dll" -->
<!--#include file="Funciones/FuncionesGenerales.asp" -->
<%
'// Recuperar la gestion de trabajo
qGestion = Session("auth_granted_poa_gestion")
sSQL = ""
sSQL = sSQL & " SELECT aper_id, aper_programa, aper_proyecto, aper_actividad, aper_descripcion, aper_ponderacion"
sSQL = sSQL & " FROM AperturaProgramatica"
sSQL = sSQL & " WHERE  (Len(aper_programa) = 2) AND (aper_proyecto = '0000') AND (aper_actividad = '000') AND (aper_gestion = "& qGestion &")"
MR = MatrixBD(sSQL, 1)
If VarType(MR) = 8  then
  QR = -1
Else
  QR = UBound(MR,2)	
End If
MaxSumPA1 = 0
MaxSumPA2 = 0
MaxSumPA3 = 0
MaxSumPA4 = 0
MaxSumPA5 = 0
MaxSumPA6 = 0
MaxSumPA7 = 0
MaxSumPA8 = 0
MaxSumPA9 = 0
MaxSumPA10 = 0
MaxSumPA11 = 0
MaxSumPA12 = 0

MaxSumEA1 = 0
MaxSumEA2 = 0
MaxSumEA3 = 0
MaxSumEA4 = 0
MaxSumEA5 = 0
MaxSumEA6 = 0
MaxSumEA7 = 0
MaxSumEA8 = 0
MaxSumEA9 = 0
MaxSumEA10 = 0
MaxSumEA11 = 0
MaxSumEA12 = 0

for w = 0 to QR 
  sSQL = ""
  sSQL = sSQL & " SELECT aper_programa, aper_proyecto, aper_actividad, aper_descripcion,"
  sSQL = sSQL & " aper_1P, aper_2P, aper_3P, aper_4P, aper_5P, aper_6P, aper_7P, aper_8P, aper_9P, aper_10P, aper_11P, aper_12P,"
  sSQL = sSQL & " aper_1E, aper_2E, aper_3E, aper_4E, aper_5E, aper_6E, aper_7E, aper_8E, aper_9E, aper_10E, aper_11E, aper_12E"
  sSQL = sSQL & " FROM AperturaProgramatica"
  sSQL = sSQL & " WHERE (aper_programa = '"& MR(1,w) &"') AND ((aper_proyecto <> '0000') OR (aper_actividad <> '000')) AND (aper_gestion = "& qGestion &")"
  
  MatrizResultado = MatrixBD(sSQL, 1)
  If VarType(MatrizResultado) = 8  then
    CuantosRegistros = -1
  Else
    CuantosRegistros = UBound(MatrizResultado,2)	
  End If
                
  SumPA1 = 0
  SumPA2 = 0
  SumPA3 = 0
  SumPA4 = 0
  SumPA5 = 0
  SumPA6 = 0
  SumPA7 = 0
  SumPA8 = 0
  SumPA9 = 0
  SumPA10 = 0
  SumPA11 = 0
  SumPA12 = 0
  
  SumEA1 = 0
  SumEA2 = 0
  SumEA3 = 0
  SumEA4 = 0
  SumEA5 = 0
  SumEA6 = 0
  SumEA7 = 0
  SumEA8 = 0
  SumEA9 = 0
  SumEA10 = 0
  SumEA11 = 0
  SumEA12 = 0
    
  If CuantosRegistros <> -1 Then 
    For i = 0 To CuantosRegistros 
      P1 = CDbl(MatrizResultado(4,i))
      P2 = CDbl(MatrizResultado(5,i))
      P3 = CDbl(MatrizResultado(6,i))
      P4 = CDbl(MatrizResultado(7,i))
      P5 = CDbl(MatrizResultado(8,i))
      P6 = CDbl(MatrizResultado(9,i))
      P7 = CDbl(MatrizResultado(10,i))
      P8 = CDbl(MatrizResultado(11,i))
      P9 = CDbl(MatrizResultado(12,i))
      P10 = CDbl(MatrizResultado(13,i))
      P11 = CDbl(MatrizResultado(14,i))
      P12 = CDbl(MatrizResultado(15,i))
      
      E1 = CDbl(MatrizResultado(16,i))
      E2 = CDbl(MatrizResultado(17,i))
      E3 = CDbl(MatrizResultado(18,i))
      E4 = CDbl(MatrizResultado(19,i))
      E5 = CDbl(MatrizResultado(20,i))
      E6 = CDbl(MatrizResultado(21,i))
      E7 = CDbl(MatrizResultado(22,i))
      E8 = CDbl(MatrizResultado(23,i))
      E9 = CDbl(MatrizResultado(24,i))
      E10 = CDbl(MatrizResultado(25,i))
      E11 = CDbl(MatrizResultado(26,i))
      E12 = CDbl(MatrizResultado(27,i))
      
      PA1 = P1
      PA2 = P1+P2
      PA3 = P1+P2+P3
      PA4 = P1+P2+P3+P4
      PA5 = P1+P2+P3+P4+P5
      PA6 = P1+P2+P3+P4+P5+P6
      PA7 = P1+P2+P3+P4+P5+P6+P7
      PA8 = P1+P2+P3+P4+P5+P6+P7+P8
      PA9 = P1+P2+P3+P4+P5+P6+P7+P8+P9
      PA10 = P1+P2+P3+P4+P5+P6+P7+P8+P9+P10
      PA11 = P1+P2+P3+P4+P5+P6+P7+P8+P9+P10+P11
      PA12 = P1+P2+P3+P4+P5+P6+P7+P8+P9+P10+P11+P12
      
      EA1 = E1
      EA2 = E1+E2
      EA3 = E1+E2+E3
      EA4 = E1+E2+E3+E4
      EA5 = E1+E2+E3+E4+E5
      EA6 = E1+E2+E3+E4+E5+E6
      EA7 = E1+E2+E3+E4+E5+E6+E7
      EA8 = E1+E2+E3+E4+E5+E6+E7+E8
      EA9 = E1+E2+E3+E4+E5+E6+E7+E8+E9
      EA10 = E1+E2+E3+E4+E5+E6+E7+E8+E9+E10
      EA11 = E1+E2+E3+E4+E5+E6+E7+E8+E9+E10+E11
      EA12 = E1+E2+E3+E4+E5+E6+E7+E8+E9+E10+E11+E12
      
      SumPA1 = SumPA1 + PA1
      SumPA2 = SumPA2 + PA2
      SumPA3 = SumPA3 + PA3
      SumPA4 = SumPA4 + PA4
      SumPA5 = SumPA5 + PA5
      SumPA6 = SumPA6 + PA6
      SumPA7 = SumPA7 + PA7
      SumPA8 = SumPA8 + PA8
      SumPA9 = SumPA9 + PA9
      SumPA10 = SumPA10 + PA10
      SumPA11 = SumPA11 + PA11
      SumPA12 = SumPA12 + PA12
      
      SumEA1 = SumEA1 + EA1
      SumEA2 = SumEA2 + EA2
      SumEA3 = SumEA3 + EA3
      SumEA4 = SumEA4 + EA4
      SumEA5 = SumEA5 + EA5
      SumEA6 = SumEA6 + EA6
      SumEA7 = SumEA7 + EA7
      SumEA8 = SumEA8 + EA8
      SumEA9 = SumEA9 + EA9
      SumEA10 = SumEA10 + EA10
      SumEA11 = SumEA11 + EA11
      SumEA12 = SumEA12 + EA12
    Next 
        TotalSumPA = AperturaProgramaticaMontoProg(MR(0,w))
        TotalSumPA = CDbl(TotalSumPA)
                          
    If TotalSumPA = 0 Then : SumPA1p = 0 : Else : SumPA1p = SumPA1/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumPA2p = 0 : Else : SumPA2p = SumPA2/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumPA3p = 0 : Else : SumPA3p = SumPA3/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumPA4p = 0 : Else : SumPA4p = SumPA4/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumPA5p = 0 : Else : SumPA5p = SumPA5/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumPA6p = 0 : Else : SumPA6p = SumPA6/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumPA7p = 0 : Else : SumPA7p = SumPA7/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumPA8p = 0 : Else : SumPA8p = SumPA8/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumPA9p = 0 : Else : SumPA9p = SumPA9/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumPA10p = 0 : Else : SumPA10p = SumPA10/TotalSumPA : End If		  
    If TotalSumPA = 0 Then : SumPA11p = 0 : Else : SumPA11p = SumPA11/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumPA12p = 0 : Else : SumPA12p = SumPA12/TotalSumPA : End If
    
    TotalSumEA = AperturaProgramaticaMontoEjec(MR(0,w))
    TotalSumEA = CDbl(TotalSumEA)
                          
    If TotalSumPA = 0 Then : SumEA1p = 0 : Else : SumEA1p = SumEA1/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumEA2p = 0 : Else : SumEA2p = SumEA2/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumEA3p = 0 : Else : SumEA3p = SumEA3/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumEA4p = 0 : Else : SumEA4p = SumEA4/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumEA5p = 0 : Else : SumEA5p = SumEA5/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumEA6p = 0 : Else : SumEA6p = SumEA6/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumEA7p = 0 : Else : SumEA7p = SumEA7/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumEA8p = 0 : Else : SumEA8p = SumEA8/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumEA9p = 0 : Else : SumEA9p = SumEA9/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumEA10p = 0 : Else : SumEA10p = SumEA10/TotalSumPA : End If		  
    If TotalSumPA = 0 Then : SumEA11p = 0 : Else : SumEA11p = SumEA11/TotalSumPA : End If
    If TotalSumPA = 0 Then : SumEA12p = 0 : Else : SumEA12p = SumEA12/TotalSumPA : End If
                          
    If SumPA1 = 0 Then : Eficacia1 = 0 : Else : Eficacia1 = SumEA1/SumPA1 : End If
    If SumPA2 = 0 Then : Eficacia2 = 0 : Else : Eficacia2 = SumEA2/SumPA2 : End If
    If SumPA3 = 0 Then : Eficacia3 = 0 : Else : Eficacia3 = SumEA3/SumPA3 : End If
    If SumPA4 = 0 Then : Eficacia4 = 0 : Else : Eficacia4 = SumEA4/SumPA4 : End If
    If SumPA5 = 0 Then : Eficacia5 = 0 : Else : Eficacia5 = SumEA5/SumPA5 : End If
    If SumPA6 = 0 Then : Eficacia6 = 0 : Else : Eficacia6 = SumEA6/SumPA6 : End If
    If SumPA7 = 0 Then : Eficacia7 = 0 : Else : Eficacia7 = SumEA7/SumPA7 : End If
    If SumPA8 = 0 Then : Eficacia8 = 0 : Else : Eficacia8 = SumEA8/SumPA8 : End If
    If SumPA9 = 0 Then : Eficacia9 = 0 : Else : Eficacia9 = SumEA9/SumPA9 : End If
    If SumPA10 = 0 Then : Eficacia10 = 0 : Else : Eficacia10 = SumEA10/SumPA10 : End If
    If SumPA11 = 0 Then : Eficacia11 = 0 : Else : Eficacia11 = SumEA11/SumPA11 : End If
    If SumPA12 = 0 Then : Eficacia12 = 0 : Else : Eficacia12 = SumEA12/SumPA12 : End If
                                      
    MaxSumPA1 = MaxSumPA1 + SumPA1
    MaxSumPA2 = MaxSumPA2 + SumPA2
    MaxSumPA3 = MaxSumPA3 + SumPA3
    MaxSumPA4 = MaxSumPA4 + SumPA4
    MaxSumPA5 = MaxSumPA5 + SumPA5
    MaxSumPA6 = MaxSumPA6 + SumPA6
    MaxSumPA7 = MaxSumPA7 + SumPA7
    MaxSumPA8 = MaxSumPA8 + SumPA8
    MaxSumPA9 = MaxSumPA9 + SumPA9
    MaxSumPA10 = MaxSumPA10 + SumPA10
    MaxSumPA11 = MaxSumPA11 + SumPA11
    MaxSumPA12 = MaxSumPA12 + SumPA12
    
    MaxSumEA1 = MaxSumEA1 + SumEA1
    MaxSumEA2 = MaxSumEA2 + SumEA2
    MaxSumEA3 = MaxSumEA3 + SumEA3
    MaxSumEA4 = MaxSumEA4 + SumEA4
    MaxSumEA5 = MaxSumEA5 + SumEA5
    MaxSumEA6 = MaxSumEA6 + SumEA6
    MaxSumEA7 = MaxSumEA7 + SumEA7
    MaxSumEA8 = MaxSumEA8 + SumEA8
    MaxSumEA9 = MaxSumEA9 + SumEA9
    MaxSumEA10 = MaxSumEA10 + SumEA10
    MaxSumEA11 = MaxSumEA11 + SumEA11
    MaxSumEA12 = MaxSumEA12 + SumEA12
            
  End If 
Next
MesActivo = Session("auth_granted_poa_mes")
If Len(MesActivo) = 0 Then MesActivo = 0 
MesActivo = CInt(MesActivo)
GranTotalSumPA = MaxSumPA12
GranTotalSumPA = CDbl(GranTotalSumPA)

If GranTotalSumPA = 0 Then : MaxSumPA1 = 0 : Else : MaxSumPA1p = MaxSumPA1/GranTotalSumPA : End If
If GranTotalSumPA = 0 Then : MaxSumPA2p = 0 : Else : MaxSumPA2p = MaxSumPA2/GranTotalSumPA : End If
If GranTotalSumPA = 0 Then : MaxSumPA3p = 0 : Else : MaxSumPA3p = MaxSumPA3/GranTotalSumPA : End If
If GranTotalSumPA = 0 Then : MaxSumPA4p = 0 : Else : MaxSumPA4p = MaxSumPA4/GranTotalSumPA : End If
If GranTotalSumPA = 0 Then : MaxSumPA5p = 0 : Else : MaxSumPA5p = MaxSumPA5/GranTotalSumPA : End If
If GranTotalSumPA = 0 Then : MaxSumPA6p = 0 : Else : MaxSumPA6p = MaxSumPA6/GranTotalSumPA : End If
If GranTotalSumPA = 0 Then : MaxSumPA7p = 0 : Else : MaxSumPA7p = MaxSumPA7/GranTotalSumPA : End If
If GranTotalSumPA = 0 Then : MaxSumPA8p = 0 : Else : MaxSumPA8p = MaxSumPA8/GranTotalSumPA : End If
If GranTotalSumPA = 0 Then : MaxSumPA9p = 0 : Else : MaxSumPA9p = MaxSumPA9/GranTotalSumPA : End If
If GranTotalSumPA = 0 Then : MaxSumPA10p = 0 : Else : MaxSumPA10p = MaxSumPA10/GranTotalSumPA : End If		  
If GranTotalSumPA = 0 Then : MaxSumPA11p = 0 : Else : MaxSumPA11p = MaxSumPA11/GranTotalSumPA : End If
If GranTotalSumPA = 0 Then : MaxSumPA12p = 0 : Else : MaxSumPA12p = MaxSumPA12/GranTotalSumPA : End If

GranTotalSumEA = MaxSumEA12
GranTotalSumEA = CDbl(GranTotalSumEA)

If GranTotalSumEA = 0 Then : MaxSumEA1p = 0 : Else : MaxSumEA1p = MaxSumEA1/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA2p = 0 : Else : MaxSumEA2p = MaxSumEA2/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA3p = 0 : Else : MaxSumEA3p = MaxSumEA3/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA4p = 0 : Else : MaxSumEA4p = MaxSumEA4/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA5p = 0 : Else : MaxSumEA5p = MaxSumEA5/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA6p = 0 : Else : MaxSumEA6p = MaxSumEA6/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA7p = 0 : Else : MaxSumEA7p = MaxSumEA7/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA8p = 0 : Else : MaxSumEA8p = MaxSumEA8/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA9p = 0 : Else : MaxSumEA9p = MaxSumEA9/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA10p = 0 : Else : MaxSumEA10p = MaxSumEA10/GranTotalSumPA : End If		  
If GranTotalSumEA = 0 Then : MaxSumEA11p = 0 : Else : MaxSumEA11p = MaxSumEA11/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA12p = 0 : Else : MaxSumEA12p = MaxSumEA12/GranTotalSumPA : End If

If MaxSumPA1 = 0 Then : MaxEficacia1 = 0 : Else : MaxEficacia1 = MaxSumEA1/MaxSumPA1 : End If
If MaxSumPA2 = 0 Then : MaxEficacia2 = 0 : Else : MaxEficacia2 = MaxSumEA2/MaxSumPA2 : End If
If MaxSumPA3 = 0 Then : MaxEficacia3 = 0 : Else : MaxEficacia3 = MaxSumEA3/MaxSumPA3 : End If
If MaxSumPA4 = 0 Then : MaxEficacia4 = 0 : Else : MaxEficacia4 = MaxSumEA4/MaxSumPA4 : End If
If MaxSumPA5 = 0 Then : MaxEficacia5 = 0 : Else : MaxEficacia5 = MaxSumEA5/MaxSumPA5 : End If
If MaxSumPA6 = 0 Then : MaxEficacia6 = 0 : Else : MaxEficacia6 = MaxSumEA6/MaxSumPA6 : End If
If MaxSumPA7 = 0 Then : MaxEficacia7 = 0 : Else : MaxEficacia7 = MaxSumEA7/MaxSumPA7 : End If
If MaxSumPA8 = 0 Then : MaxEficacia8 = 0 : Else : MaxEficacia8 = MaxSumEA8/MaxSumPA8 : End If
If MaxSumPA9 = 0 Then : MaxEficacia9 = 0 : Else : MaxEficacia9 = MaxSumEA9/MaxSumPA9 : End If
If MaxSumPA10 = 0 Then : MaxEficacia10 = 0 : Else : MaxEficacia10 = MaxSumEA10/MaxSumPA10 : End If
If MaxSumPA11 = 0 Then : MaxEficacia11 = 0 : Else : MaxEficacia11 = MaxSumEA11/MaxSumPA11 : End If
If MaxSumPA12 = 0 Then : MaxEficacia12 = 0 : Else : MaxEficacia12 = MaxSumEA12/MaxSumPA12 : End If


GranTotalSumEA = MaxSumEA12
GranTotalSumEA = CDbl(GranTotalSumEA)

If GranTotalSumEA = 0 Then : MaxSumEA1p = 0 : Else : MaxSumEA1p = MaxSumEA1/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA2p = 0 : Else : MaxSumEA2p = MaxSumEA2/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA3p = 0 : Else : MaxSumEA3p = MaxSumEA3/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA4p = 0 : Else : MaxSumEA4p = MaxSumEA4/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA5p = 0 : Else : MaxSumEA5p = MaxSumEA5/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA6p = 0 : Else : MaxSumEA6p = MaxSumEA6/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA7p = 0 : Else : MaxSumEA7p = MaxSumEA7/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA8p = 0 : Else : MaxSumEA8p = MaxSumEA8/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA9p = 0 : Else : MaxSumEA9p = MaxSumEA9/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA10p = 0 : Else : MaxSumEA10p = MaxSumEA10/GranTotalSumPA : End If		  
If GranTotalSumEA = 0 Then : MaxSumEA11p = 0 : Else : MaxSumEA11p = MaxSumEA11/GranTotalSumPA : End If
If GranTotalSumEA = 0 Then : MaxSumEA12p = 0 : Else : MaxSumEA12p = MaxSumEA12/GranTotalSumPA : End If
Select Case MesActivo
Case 0 : 
  MesActivoProgramacion = ""
  MesActivoProgramacionP = ""	
  MesActivoEjecucion = ""
  MesActivoEjecucionP = ""
  MesActivoEficacia = ""
  Mes = ""
Case 1 : 
  MesActivoProgramacion = MaxSumPA1
  MesActivoProgramacionP = MaxSumPA1p*100	
  MesActivoEjecucion = MaxSumEA1
  MesActivoEjecucionP = MaxSumEA1p*100
  MesActivoEficacia = MaxEficacia1*100
  Mes = "Ene"
Case 2 : 
  MesActivoProgramacion = MaxSumPA2
  MesActivoProgramacionP = MaxSumPA2p*100
  MesActivoEjecucion = MaxSumEA2
  MesActivoEjecucionP = MaxSumEA2p*100
  MesActivoEficacia = MaxEficacia2*100
  Mes = "Feb"
Case 3 : 
  MesActivoProgramacion = MaxSumPA3
  MesActivoProgramacionP = MaxSumPA3p*100
  MesActivoEjecucion = MaxSumEA3
  MesActivoEjecucionP = MaxSumEA3p*100
  MesActivoEficacia = MaxEficacia3*100
  Mes = "Mar"
Case 4 : 
  MesActivoProgramacion = MaxSumPA4
  MesActivoProgramacionP = MaxSumPA4p*100
  MesActivoEjecucion = MaxSumEA4
  MesActivoEjecucionP = MaxSumEA4p*100
  MesActivoEficacia = MaxEficacia4*100
  Mes = "Abr"
Case 5 : 
  MesActivoProgramacion = MaxSumPA5
  MesActivoProgramacionP = MaxSumPA5p*100
  MesActivoEjecucion = MaxSumEA5
  MesActivoEjecucionP = MaxSumEA5p*100
  MesActivoEficacia = MaxEficacia5*100
  Mes = "May"
Case 6 : 
  MesActivoProgramacion = MaxSumPA6
  MesActivoProgramacionP = MaxSumPA6p*100	
  MesActivoEjecucion = MaxSumEA6
  MesActivoEjecucionP = MaxSumEA6p*100
  MesActivoEficacia = MaxEficacia6*100
  Mes = "Jun"
Case 7 : 
  MesActivoProgramacion = MaxSumPA7
  MesActivoProgramacionP = MaxSumPA7p*100	
  MesActivoEjecucion = MaxSumEA7
  MesActivoEjecucionP = MaxSumEA7p*100
  MesActivoEficacia = MaxEficacia7*100
  Mes = "Jul"
Case 8 : 
  MesActivoProgramacion = MaxSumPA8
  MesActivoProgramacionP = MaxSumPA8p*100
  MesActivoEjecucion = MaxSumEA8
  MesActivoEjecucionP = MaxSumEA8p*100
  MesActivoEficacia = MaxEficacia8*100
  Mes = "Ago"
Case 9 : 
  MesActivoProgramacion = MaxSumPA9
  MesActivoProgramacionP = MaxSumPA9p*100
  MesActivoEjecucion = MaxSumEA9
  MesActivoEjecucionP = MaxSumEA9p*100
  MesActivoEficacia = MaxEficacia9*100
  Mes = "Sep"
Case 10 : 
  MesActivoProgramacion = MaxSumPA10
  MesActivoProgramacionP = MaxSumPA10p*100
  MesActivoEjecucion = MaxSumEA10
  MesActivoEjecucionP = MaxSumEA10p*100
  MesActivoEficacia = MaxEficacia10*100
  Mes = "Oct"
Case 11 : 
  MesActivoProgramacion = MaxSumPA11
  MesActivoProgramacionP = MaxSumPA11p*100
  MesActivoEjecucion = MaxSumEA11
  MesActivoEjecucionP = MaxSumEA11p*100
  MesActivoEficacia = MaxEficacia11*100
  Mes = "Nov"
Case 12 : 
  MesActivoProgramacion = MaxSumPA12
  MesActivoProgramacionP = MaxSumPA12p*100
  MesActivoEjecucion = MaxSumEA12
  MesActivoEjecucionP = MaxSumEA12p*100
  MesActivoEficacia = MaxEficacia12*100
  Mes = "Dic"
Case Else : 
  MesActivoProgramacion = MaxSumPA12
  MesActivoProgramacionP = MaxSumPA12p*100
  MesActivoEjecucion = MaxSumEA12
  MesActivoEjecucionP = MaxSumEA12p*100
  MesActivoEficacia = MaxEficacia12*100
  Mes = "Dic"
End Select 	

%>
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
<link href="Estilos/EstilosPagina.css" rel="stylesheet" type="text/css">
<script src="Scripts/KendoUI/jquery.min.js"></script>
<script src="Scripts/KendoUI/kendo.dataviz.min.js"></script>
<script src="Scripts/KendoUI/console.js"></script>

<table width="400" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
      <td>
        
          <table width="60%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#ACACAC" style="border-collapse:collapse;">
                <tr align="center">
                    <td bgcolor="#DBDBDB">Estado</td>
                    <td bgcolor="#DBDBDB"><%=Mes%></td>
                </tr>
                <tr>
                    <td>Prog. Acumulada</td>
                    <td align="right"><%=Formatnumber(MesActivoProgramacion,2)%> Bs.</td>
                </tr>
                <tr>
                    <td>Ejec. Acumulada</td>
                    <td align="right"><%=Formatnumber(MesActivoEjecucion,2)%> Bs.</td>
                </tr>
                <tr>
                    <td>% Prog. Acumulada</td>
                    <td align="right"><%=Formatnumber(MesActivoProgramacionP,2)%> %</td>
                </tr>
                <tr>
                    <td>% Ejec. Acumulada</td>
                    <td align="right"><%=Formatnumber(MesActivoEjecucionP,2)%> %</td>
                </tr>
                <tr>
                    <td>Eficacia</td>
                    <td align="right"><strong><%=Formatnumber(MesActivoEficacia,2)%> %</strong></td>
                </tr>
            </table>
        
        </td>
    </tr>
    <tr>
      <td width="345" align="center" valign="middle">
              <div id="gauge-container">
                  <div id="gauge"></div>
              </div>

              <script>
                function createGauge(labelPosition) {
                    $("#gauge").kendoRadialGauge({
                        theme: $(document).data("kendoSkin") || "default",

                        pointer: {
                            value: <%=MesActivoEficacia%>
                        },

                        scale: {
                            minorUnit: 5,
                            startAngle: -30,
                            endAngle: 210,
                            max: 100,
                            labels: {
                                position: labelPosition || "inside"
                            },
                            ranges: [
                                {
                                    from: 0,
                                    to: 75,
                                    color: "#F00"
                                }, {
                                    from: 75,
                                    to: 90,
                                    color: "#FF0"
                                }, {
                                    from: 90,
                                    to: 100,
                                    color: "#060"
                                }
                            ]
                        }
                    });
                }

                $(document).ready(function() {
                    createGauge();

                    $(".configuration").bind("change", refresh);

                    $(document).bind("kendo:skinChange", function(e) {
                        createGauge();
                    });

                    window.configuredRanges = $("#gauge").data("kendoRadialGauge").options.scale.ranges;
                });

                function refresh() {
                    var gauge = $("#gauge").data("kendoRadialGauge"),
                        showLabels = $("#labels").prop("checked"),
                        showRanges = $("#ranges").prop("checked"),
                        positionInputs = $("input[name='labels-position']"),
                        labelsPosition = positionInputs.filter(":checked").val(),
                        options = gauge.options;

                    options.transitions = false;
                    options.scale.labels.visible = showLabels;
                    options.scale.labels.position = labelsPosition;
                    options.scale.ranges = showRanges ? window.configuredRanges : [];

                    gauge.redraw();
                }
              </script>

              <style scoped>
                #gauge-container {
                    background: transparent url("Imagenes/gauge-container1.png") no-repeat 50% 50%;
                    width: 300px;
                    height: 300px;
                    text-align: center;
                 }

                #gauge {
                    width: 245px;
                    height: 245px;
                    margin: 0 auto 0;
                }
              </style>
          
    </td>
    </tr>
</table>
